// GLFrame.h
//
#ifndef GLFRAME_H
#define GLFRAME_H

#include "OpenGL.h"

#include <QGraphicsView>

// IDEAS - OpenGLView
class QGLWidget;
class QMouseEvent;
class QKeyEvent;
class QMouseEvent;


namespace IDS {
namespace IDEAS	{
namespace OpenGLView {
namespace Fwk {

class MainWindow;

// ------------------------------------------------------------------------------------------------
// The OpenGL Canvas class
class GLFrame: public QGraphicsView
{
	Q_OBJECT 

protected:
	MainWindow  *mainWindow;
	QGLWidget   *glContext;
	GLEWContext *glewContext;
	int width, height;

	// QT Code
	void resizeEvent		( QResizeEvent *e );
	void mousePressEvent    ( QMouseEvent *e  );
	void mouseMoveEvent     ( QMouseEvent *e  );
	void mouseReleaseEvent  ( QMouseEvent *e  );
	void wheelEvent			( QWheelEvent *e  );
	void leaveEvent			( QEvent *e);
	void enterEvent			( QEvent *e);

public:
	// Constructor
	GLFrame(MainWindow *_mainWindow);
	
	// Destructor
	virtual ~GLFrame();

	bool init();
	void makeCurrent();

	void setCursor( const QCursor &cur );

	//
	//QGLWidget *getContext()	{return glContext;}

	//
	QSize getClientSize() {return QSize(width,height);}
};




 }}}}

#endif // GLFRAME_H
